package com.springdemo.spring5;

import com.springdemo.spring5.bean.Employee;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * User: zjz
 * Date: 2022/02/23 15:41
 * Description:
 * Version: V1.0
 */
public class TestBean {
    @Test
    public void Test(){
        //1.加载spring配置文件
        ApplicationContext context=new ClassPathXmlApplicationContext("bean4.xml");

        //2. 获取配置创建的对象
        Employee employee=context.getBean("employee",Employee.class);

        employee.test();
    }
}
